package com.appbee.adminshell.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class Shell extends Composite
{

	private static ShellUiBinder uiBinder = GWT.create(ShellUiBinder.class);

	interface ShellUiBinder extends UiBinder<Widget, Shell>
	{
	}
	
	interface Templates extends SafeHtmlTemplates
	{
		@Template("<a href='{0}'>{1}</a>")
		SafeHtml loginLink(String link,String label);
		
	}
	
	Templates template = GWT.create(Templates.class);
	
	@UiField
	AcceptsOneWidget mainPanel;
	
	@UiField
	Element userName;
	
	public Shell()
	{
		initWidget(uiBinder.createAndBindUi(this));
	}

	public AcceptsOneWidget getMainPanel()
	{
		return mainPanel;
	}

	public void setUserLabel(String userLabelStr)
	{
		this.userName.setInnerText(userLabelStr);
	}
}
